package com.xinkao.example.swagger.controller;

import java.util.List;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xinkao.example.domain.entity.UploadFileEntity;


/**
 * 文件上传
 * @Author 
 * @Date 2021-08-27 10:31:50
 */
@RestController
@Api(tags = "文件上传")
@RequestMapping("/uploadFile/Swagger")
public class UploadFileControllerSwagger{

    /**
     * 分页查询
     */
    @ApiOperation(value = "分页查询", response = UploadFilePageEntity.class)
    @PostMapping("/list")
    public JSONObject list(@RequestBody UploadFilePageParamEntity entity){
        return null;
    }
    @Data
    @ApiModel("文件上传分页参数实体")
    public class UploadFilePageParamEntity extends UploadFileEntity{
        @ApiModelProperty("页码")
        private Integer pageNum;
        @ApiModelProperty("页数")
        private Integer pageRow;
    }
    @Data
    @ApiModel("文件上传分页实体")
    public class UploadFilePageEntity{
        @ApiModelProperty("返回信息")
        private String msg;
        @ApiModelProperty("状态码")
        private String code;
        @ApiModelProperty("返回数据")
        private SubData data;
        @Data
        public class SubData {
            @ApiModelProperty("总条数")
            private Integer totalCount;
            @ApiModelProperty("详细数据")
            private List<UploadFileEntity> list;
        }
    }

    /**
     * 列表查询
     */
    @ApiOperation(value = "列表查询", response = UploadFileListEntity.class)
    @PostMapping("/listByCondition")
    public JSONObject listByCondition(@RequestBody UploadFileEntity entity){
        return null;
    }
    @Data
    @ApiModel("文件上传列表实体")
    public class UploadFileListEntity{
        @ApiModelProperty("返回信息")
        private String msg;
        @ApiModelProperty("状态码")
        private String code;
        @ApiModelProperty("返回数据")
        private List<UploadFileEntity> data;
    }

    /**
     * 查询详情
     */
    @ApiOperation(value = "查询详情", response = UploadFileInfoEntity.class)
    @PostMapping("/info/{id}")
    public JSONObject info(@PathVariable("id") String id){
        return null;
    }
    @Data
    @ApiModel("文件上传详情实体")
    public class UploadFileInfoEntity{
        @ApiModelProperty("返回信息")
        private String msg;
        @ApiModelProperty("状态码")
        private String code;
        @ApiModelProperty("返回数据")
        private UploadFileEntity data;
    }

    /**
     * 新增
     */
    @ApiOperation(value = "新增", response = UploadFileComEntity.class)
    @PostMapping("/save")
    public JSONObject save(@RequestBody UploadFileEntity entity){
        return null;
    }

    /**
     * 修改
     */
    @ApiOperation(value = "修改", response = UploadFileComEntity.class)
    @PostMapping("/edit")
    public JSONObject edit(@RequestBody UploadFileEntity entity){
        return null;
    }

    /**
     * 删除/批量删除
     */
    @ApiOperation(value = "删除/批量删除", response = UploadFileComEntity.class)
    @PostMapping("/delete")
    public JSONObject delete(@RequestBody List<String> ids){
        return null;
    }
    @Data
    @ApiModel("文件上传通用实体")
    public class UploadFileComEntity{
        @ApiModelProperty("返回信息")
        private String msg;
        @ApiModelProperty("状态码")
        private String code;
        @ApiModelProperty("返回数据")
        private String data;
    }
}
